package com.profound.blog.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.profound.blog.bean.Blog;
import com.profound.blog.dao.BlogDAO;

@Service
public class BlogService {

	@Autowired
	private BlogDAO dao;
	
	public Blog applyBlog(Blog blog){
		if(1!=dao.addBlog(blog)){
			return null;
		}else{
			return blog;
		}
	}
	
	public boolean modifyBlog(Blog blog){
		boolean ok = false;
		if(1==dao.updateBlog(blog)){
			ok=true;
		}
		return ok;
	}

}
